package sms;

import java.time.LocalDate;

public class Demo04 {
    public static void main(String[] args) {
        //method01();
        //method02();
        StudentManagementSystem03 sms = new StudentManagementSystem03();
        //1.添加学生
        sms.addStudent(new PrimaryStudent(20241316,"小新",77,81
                , LocalDate.parse("2013-10-12"),"233434@qq.com"));
        sms.addStudent(new PrimaryStudent(20241327,"小明",90,88
                , LocalDate.parse("2014-11-12"),"233534@qq.com"));
        sms.addStudent(new PrimaryStudent(20241333,"花花",90,64
                , LocalDate.parse("2023-10-15"),"233434@qq.com"));
        sms.addStudent(new PrimaryStudent(20241335,"花花",71,83
                , LocalDate.parse("2024-12-12"),"123123323@qq.com"));

        //2.展示学生
        System.out.println("=========展示所有学生=========");
        sms.showAllStudents();

        //3.获取指定科目的最高或最低成绩
        System.out.println("=========获取指定科目的最高或最低成绩=========");
        System.out.println(sms.findStudentWithHighestScore("语文"));
        System.out.println(sms.findStudentWithLowestScore("数学"));

        //4.获取指定科目下所有成绩对应的人数
        System.out.println("=========获取指定科目下所有成绩对应的人数=========");
        System.out.println(sms.getScoreStatisticsBySubject("语文"));
    }

    private static void method02() {
        StudentManagementSystem03 sms = new StudentManagementSystem03();
        //1.添加学生
        sms.addStudent(new PrimaryStudent(20241316,"小新",77,81
                , LocalDate.parse("2013-10-12"),"233434@qq.com"));
        sms.addStudent(new PrimaryStudent(20241327,"小明",95,88
                , LocalDate.parse("2014-11-12"),"233534@qq.com"));
        sms.addStudent(new PrimaryStudent(20241333,"花花",90,64
                , LocalDate.parse("2023-10-15"),"233434@qq.com"));
        sms.addStudent(new PrimaryStudent(20241335,"天天",71,83
                , LocalDate.parse("2024-12-12"),"123123323@qq.com"));

        //2.展示学生
        System.out.println("=========展示所有学生=========");
        sms.showAllStudents();

        System.out.println("=========按照学生的总分从高到低排序=========");
        sms.sortByTotalScore();
        sms.showAllStudents();
    }

    private static void method01() {
        StudentManagementSystem03 sms = new StudentManagementSystem03();
        //1.添加学生
        sms.addStudent(new PrimaryStudent(20241316,"小新",77,81
                , LocalDate.parse("2013-10-12"),"233434@qq.com"));
        sms.addStudent(new PrimaryStudent(20241327,"小明",95,88
                , LocalDate.parse("2014-11-12"),"233534@qq.com"));
        sms.addStudent(new PrimaryStudent(20241333,"花花",90,63
                , LocalDate.parse("2023-10-15"),"233434@qq.com"));
        sms.addStudent(new PrimaryStudent(20241335,"天天",71,83
                , LocalDate.parse("2024-12-12"),"123123323@qq.com"));

        //2.展示学生
        System.out.println("=========展示所有学生=========");
        sms.showAllStudents();

        System.out.println("=========按照学生的总分从高到低排序=========");
        sms.sortByTotalScore();
        sms.showAllStudents();
    }
}

